home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / glibc-1.09 / glibc-1 / glibc-1.09.1 / sysdeps / unix / bsd / i386 / __wait3.S < prev   
Encoding:
Text File  |  1994-07-18  |  1.6 KB  |  43 lines

  1. /* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. #include <sysdep.h>
  20.  
  21. /* <sysdeps/unix/bsd/sequent/i386/sysdep.h> defines this to put the first
  22.    two arguments into registers.  Since the arguments to wait3 are
  23.    transferred magically through the same registers, we want to disable this.
  24.    This allows us to avoid rewriting this file for that system.  */
  25.  
  26. #undef    ARGS_2
  27. #define ARGS_2    /* Special-case no-op.  */
  28.  
  29. .text
  30. .globl syscall_error
  31. .align 4
  32. ENTRY (__wait3)
  33.     mov 8(%esp), %ecx    /* Flags.  */
  34.     mov 12(%esp), %edx    /* rusage pointer.  */
  35.     pushl $0xdf; popf    /* Set all the condition codes.  */
  36.     DO_CALL (wait, 2)    /* Do the system call.  */
  37.     je syscall_error    /* Check for error.  */
  38.     mov 4(%esp), scratch    /* Status pointer.  */
  39.     orl scratch, scratch    /* Is it nil?  */
  40.     je done            /* Yup; return.  */
  41.     mov r1, 0(scratch)    /* Non-nil; store the status in it.  */
  42. done:    ret
  43.